# == Schema Information
#
# Table name: company_cases
#
#  id            :bigint           not null, primary key
#  content       :string
#  deleted_at    :datetime
#  order_number  :integer
#  created_at    :datetime         not null
#  updated_at    :datetime         not null
#  admin_user_id :integer
#  company_id    :integer
#
# Indexes
#
#  index_company_cases_on_admin_user_id  (admin_user_id)
#  index_company_cases_on_company_id     (company_id)
#
class CompanyCase < ApplicationRecord
  def regular
    self.content.match(/<img.+src=.'?(.+\.(jpg|gif|bmp|bnp|png|jpeg))'?.+>/i).to_a.second rescue nil
  end
end
